UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l4CGv5YV38aeqprt97tLDmwP2rPng1BRMK/WZaFdAU8=' 
WHERE 
  key_id = '24163b9a22884322bf58b381f3f855f76742d12859087734a7f2b557ab2658fd' 
  AND (
    token = 'l4CGv5YV38aeqprt97tLDmwP2rPng1BRMK/WZaFdAU8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038