UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AbWyXOSEI5Zvo7qfyJkJLZmpiM2Hk6fHmaYM4UP0B94='
WHERE
key_id = 'b3d93a0f03d3a97405b1e5418d757ea840bbe524860443df80388a9a3ae1404d'
AND (
token = 'AbWyXOSEI5Zvo7qfyJkJLZmpiM2Hk6fHmaYM4UP0B94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)