UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '988GLGQCZO9fc/UrbBPcNJg1GJj/jiZ01uM6X31kQRI='
WHERE
key_id = 'ee80def3d6798a05dbdb847176398e2e2adfa05fac101070e89e984bd6efa17b'
AND (
token = '988GLGQCZO9fc/UrbBPcNJg1GJj/jiZ01uM6X31kQRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)