UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Dz5RLcNGj6smL5YoYmlG7yjOIZc81y/0TUDhPaybXU='
WHERE
key_id = '37f66db114f1c74649aedd2b1fbfed5311f6b369b2fcae1af4827183f14b3eaf'
AND (
token = '/Dz5RLcNGj6smL5YoYmlG7yjOIZc81y/0TUDhPaybXU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)