UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AHliYWfR0aMsNqzHnKKW6eh1GI869zHbhiVuiOSp/jE='
WHERE
key_id = 'dea5ade5dd9832ce48afd414a0f536272425c6abd980d1fe8af6abdc30541a59'
AND (
token = 'AHliYWfR0aMsNqzHnKKW6eh1GI869zHbhiVuiOSp/jE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)