UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v+j06SFu9XhCAgj1wEkkL8YcQh1dfBb8fQFKi0gF4BI=' 
WHERE 
  key_id = 'b201873dd3a162688a3950f7e107cc450d23f024351a31ffd38f7d08c7304fb0' 
  AND (
    token = 'v+j06SFu9XhCAgj1wEkkL8YcQh1dfBb8fQFKi0gF4BI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036