UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lEXLAreFN9U8TTX170tidsRIfPihCFGediCspIoQo1A=' 
WHERE 
  key_id = '2d3a8fbd121ba07f402cf88a695933534e4c77c2342b94d5d2b08f66ccb684d3' 
  AND (
    token = 'lEXLAreFN9U8TTX170tidsRIfPihCFGediCspIoQo1A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037