UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mdb6GOTnNPAQSkqIUdEBKlJql8U7SCO063MGDIUbN/U='
WHERE
key_id = '0ddd31e395137c1e4c501f66fe5c70926b4bc9891cf4746962adf89c35a9dbaa'
AND (
token = 'Mdb6GOTnNPAQSkqIUdEBKlJql8U7SCO063MGDIUbN/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)