UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4NzBBimEUm20g8iBNlYUqkSbXea8OjK7C7FYLlr+OQc='
WHERE
key_id = 'd3bf9ff0dca1b6113e93356ca930120bdddb52a0f86a61c8efc81847f1116f59'
AND (
token = '4NzBBimEUm20g8iBNlYUqkSbXea8OjK7C7FYLlr+OQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)