UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1LaVKZQ3evGMzVyHBiDX+8lplicK65Q39ZG69bCDmSQ='
WHERE
key_id = '30e55f677f4dc6e3b2eef02e1534968510ce7c7d210a744c4660c0b344098dd8'
AND (
token = '1LaVKZQ3evGMzVyHBiDX+8lplicK65Q39ZG69bCDmSQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)