UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dIeXUpcL6bxL36vdulfl0d/+ArhBhvQmHKfFRO4WD7k=' 
WHERE 
  key_id = '10b2d70cf268c5a6c447e8e5e83235889b6cc4f769d877819fffbd9665944ce4' 
  AND (
    token = 'dIeXUpcL6bxL36vdulfl0d/+ArhBhvQmHKfFRO4WD7k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031