UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fXjnoAvDZ9poZswn/81aw3DJ5YfXoaQkVQNTs/KCIAI=' 
WHERE 
  key_id = 'a4e4f47e6eca275210d84cf61880a1fc9bcfc64437b24e85cc387d95a15f370e' 
  AND (
    token = 'fXjnoAvDZ9poZswn/81aw3DJ5YfXoaQkVQNTs/KCIAI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021