UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OhRc6PWbCqfeQqv1JLbSt3JkWXt+IiVxpdX/f9QK8b8=' 
WHERE 
  key_id = 'e0814da051a8d260260d5dc27d8cc908097425f941767bd9579e8259619617f2' 
  AND (
    token = 'OhRc6PWbCqfeQqv1JLbSt3JkWXt+IiVxpdX/f9QK8b8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031