UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lh71RfX9r3lUpjba+dy0PlW5XoQl3VCnieJB9i7W2eM='
WHERE
key_id = 'ea2fc56fd38aac87c8f425f666bfaa3324a11f8047b16ac49f825c5d8ab6b5df'
AND (
token = 'lh71RfX9r3lUpjba+dy0PlW5XoQl3VCnieJB9i7W2eM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)