UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YVtaCPhtoYErjyB6U5rOmpeF6svXhIqM/m7rsKufPLs='
WHERE
key_id = '4276d4b0fb023be131400630356b7e9c8cdde50b33bddbf568b0bcfabdfce841'
AND (
token = 'YVtaCPhtoYErjyB6U5rOmpeF6svXhIqM/m7rsKufPLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)