UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SDK/kQFhArhjE0OfGY3J82OhOLOe0B5O+Xov3PSIzxg='
WHERE
key_id = '50017e5b396c575d0f53d3d8b0deaa477448cee24996cdd73263fb43b96b535b'
AND (
token = 'SDK/kQFhArhjE0OfGY3J82OhOLOe0B5O+Xov3PSIzxg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)