UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hIwyzMTmktX1rdR5rZqf347113ZegwIIXrIT7FInPOY=' 
WHERE 
  key_id = '8777cdcada4df1c048ac8bab7f0ffcc2a40c1ae55ac187864a7dae9b8387b5a9' 
  AND (
    token = 'hIwyzMTmktX1rdR5rZqf347113ZegwIIXrIT7FInPOY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024