UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+lKcwSdOWnloXjCzUoZtguuRL3ywL5BJVv1I5YLZQCo='
WHERE
key_id = '4eedceadc4ee80fe2e9a3b7239fa1543dc16f2eae67f91e1d9eb925a5a16d443'
AND (
token = '+lKcwSdOWnloXjCzUoZtguuRL3ywL5BJVv1I5YLZQCo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)