UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cStj3BfltzgZMGtY8cYYK2wxfsYL5JTh3WO4olhownA='
WHERE
key_id = 'f9b95dcd8516a34c1d9c8247719cc7d2492b74f69ba31b83f74c6d46424ecaf3'
AND (
token = 'cStj3BfltzgZMGtY8cYYK2wxfsYL5JTh3WO4olhownA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)