UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o+hhZyt222TE8rWC5M9FU0dL3h37yX/7J0C06bnMakI='
WHERE
key_id = '5d3cd0ce6ba1960b778705203fb0aa7ba1c99ee2ad9737d952d12ef2af4218d3'
AND (
token = 'o+hhZyt222TE8rWC5M9FU0dL3h37yX/7J0C06bnMakI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)