UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9zjdFCFsQLBczl5TAg60WOOHkRy4kUnPkYAkE8poiYs=' 
WHERE 
  key_id = 'ac2567192e3b3b1607b9439c0dedb8ecb1218cbe2a94e76099eb624e1247d90b' 
  AND (
    token = '9zjdFCFsQLBczl5TAg60WOOHkRy4kUnPkYAkE8poiYs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040