UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XyyayD8Kr7pCNxLp/XnQEkr6pLSWfWy4GdzmVjV0muc='
WHERE
key_id = 'bb9b4ac1f4f5ac38d2e9a46ca979352b72644151e89f3b3c55c6f5b6045f1c04'
AND (
token = 'XyyayD8Kr7pCNxLp/XnQEkr6pLSWfWy4GdzmVjV0muc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)