UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zoO7OX8MKdNriif/088U4y3yFOMR5bNzpxR9sVSCny8='
WHERE
key_id = 'd2c63f89f0b94f2ed3973af00e7982813c2bd21d2b000b07bb44def61f32c3eb'
AND (
token = 'zoO7OX8MKdNriif/088U4y3yFOMR5bNzpxR9sVSCny8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)