UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4pjhufLeTi8OvarV/MREQMfs6kcEWLiiM6X3m4FGJMI='
WHERE
key_id = '08c5202dec85050983005f844879d96a113443cbe4cf1ae96eb304dcd2cbc73c'
AND (
token = '4pjhufLeTi8OvarV/MREQMfs6kcEWLiiM6X3m4FGJMI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)