UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H41e5xYk/BeJPpAe8Ad3ZfK79272w1I9YaYWVp2gqrk=' 
WHERE 
  key_id = '3faeeeddeb755355c55a22eff3c855e402f2f1c002d818fa8c262fce819eac4e' 
  AND (
    token = 'H41e5xYk/BeJPpAe8Ad3ZfK79272w1I9YaYWVp2gqrk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033