UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uInzFay1QAX15YzVmK5hGCxOUjR1mj/gMGXpVC1mrnU=' 
WHERE 
  key_id = '79b24ec4812fe28564da1ed98b9a46e861de11e2ec6056ae2461bbb24f1baa58' 
  AND (
    token = 'uInzFay1QAX15YzVmK5hGCxOUjR1mj/gMGXpVC1mrnU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044