UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BOtl+1Qq7dIecmL7kQFL6I5JI1Gfmpo5JvSwZqMqEHs='
WHERE
key_id = 'cad5c80c340d6b9ab5f7cafee9445d4b10f3b06e16ce994803b3356ea2d8a8f0'
AND (
token = 'BOtl+1Qq7dIecmL7kQFL6I5JI1Gfmpo5JvSwZqMqEHs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)