UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bH7Jc136oR83WXavXqmWANj5wpFdTIOdEF8HAR4SNwc=' 
WHERE 
  key_id = '05f6ced72a0841399eee3d8b36bc340a4a5c41242fc4b09fb62abd87f2ddf845' 
  AND (
    token = 'bH7Jc136oR83WXavXqmWANj5wpFdTIOdEF8HAR4SNwc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033