UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'woEQX/rrb1M4VZUDn4nk+D7Ia/drTGFxegCCgYMb7/4='
WHERE
key_id = '80f4a81d42214a84ae22a7a0d0a7606c1d622262f6abba3c4c096fbb24db689a'
AND (
token = 'woEQX/rrb1M4VZUDn4nk+D7Ia/drTGFxegCCgYMb7/4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)