UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZSbhHaJG2PBclqr1zOxUmYx8tDJCQddGjbg4/AZEnD4='
WHERE
key_id = 'eead7100de23695f7db594d37fe28ca53b1d835e5c3ef3c3d3c0c2038548af61'
AND (
token = 'ZSbhHaJG2PBclqr1zOxUmYx8tDJCQddGjbg4/AZEnD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)