UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l+9lLSeNXmhU3PuM5vXAiHr3pGn0g0OJ3zMLg/dMdbg='
WHERE
key_id = 'e58ca49564a21041105f5d36f911240e945bd29f99b8b809eb9607cd71e064cf'
AND (
token = 'l+9lLSeNXmhU3PuM5vXAiHr3pGn0g0OJ3zMLg/dMdbg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)