UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MLusKGGB/vXEU97/PKvbShKZKHS5F4RXp7AbWrAmhR8='
WHERE
key_id = '47da90c36469027c70358da7fff3279e07504fca407f8b4e21dc40cdce8c16c3'
AND (
token = 'MLusKGGB/vXEU97/PKvbShKZKHS5F4RXp7AbWrAmhR8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)