UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3RjDpnb8bjQvo0h6ytKms95/R8ImLS0xmNeSiqFScWw='
WHERE
key_id = '1af1b7cb8c90e580b0ec3f5ed33a8309d026eb46ce964c3d099faa58a5bee8eb'
AND (
token = '3RjDpnb8bjQvo0h6ytKms95/R8ImLS0xmNeSiqFScWw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)