UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1Y86eSTrTAi5M2I2gXjsD29NDjPJpd8hXCW6ca5Ab9Y='
WHERE
key_id = '452dc39db2f6f0c2b263f2e73c2a48ced8ab93a72555350861fbd72c06825214'
AND (
token = '1Y86eSTrTAi5M2I2gXjsD29NDjPJpd8hXCW6ca5Ab9Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)