UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'obmUCNfs2Ii/wADx0HUvLBe71BgWs6ul3LNOELCPiqs='
WHERE
key_id = '5bbc7032bd8a5d751a8468cd1a993012b0576c9f54019ab28990905b438c0b61'
AND (
token = 'obmUCNfs2Ii/wADx0HUvLBe71BgWs6ul3LNOELCPiqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)