UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6OlAJqSQVFYiv1HAATq/W683LO7E/9DNVhDsgM7DbTI='
WHERE
key_id = 'c08ddc442423872165c880c5cf4525c05b00fa8d97c22ea00be11c06789ef433'
AND (
token = '6OlAJqSQVFYiv1HAATq/W683LO7E/9DNVhDsgM7DbTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)