UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IIYoCaL3CpIDO/Wp3u5QcSSIEdMi+QRm20zPjk1eEKg='
WHERE
key_id = '505591acd4dcf616e7f773bb235d236a192279de003fe297197f6d01cde57bcf'
AND (
token = 'IIYoCaL3CpIDO/Wp3u5QcSSIEdMi+QRm20zPjk1eEKg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)