UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8fKcCN8xFX31KdOUMULv2FU29v9s+qp4IV5rIsmt9bo=' 
WHERE 
  key_id = '8b4bc739fc5d04e7c6d74cbeeeef31fc7a5bc2854d16d01e01875ea26db5cc5f' 
  AND (
    token = '8fKcCN8xFX31KdOUMULv2FU29v9s+qp4IV5rIsmt9bo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035